﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Eratosthenes
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        bool[] MyArray = new bool[n];
        for (int i = 2; i < MyArray.Length; i++)
        {
            MyArray[i] = true;
        }
            
        int NSqrt = (int)(Math.Sqrt(n));
        for (int i = 2; i < NSqrt; i++)
		{
            if (MyArray[i] == true)
            {
                for (int j = 0; i * i + j * i < n; j++)
		            {
			            MyArray[i*i + j*i] = false;
		            }
			}
        }
        for (int r = 0; r < MyArray.Length; r++)
        {
            if (MyArray[r] == true)
            {
                Console.WriteLine(r);
            }
        }
    }

}
